using System;
using System.Collections.Generic;
using System.Text;
using System.ComponentModel;
using Rss;

namespace LWRSSReader
{
	internal class RssFeedWrapTypeConverter : ExpandableObjectConverter
	{
		public override object ConvertTo(ITypeDescriptorContext context, System.Globalization.CultureInfo culture, object value, Type destType )
		{
			if (destType == typeof(string) && value is RssFeedWrap)
			{
				RssFeedWrap rssFeedWrap = (RssFeedWrap)value;

				if (rssFeedWrap.Url == String.Empty)
					return global::LWRSSReader.Properties.Resources.STR_PLEASE_FILL_IN_THE_FEEDS_URL;
				if (rssFeedWrap.RssSelectedChannel != null)
					return rssFeedWrap.RssSelectedChannel.Title;
				return rssFeedWrap.Url;
			}
			return base.ConvertTo(context,culture,value,destType);
		}
	}
}
